package com.company.ddd.controller;

import com.company.ddd.application.service.IUserService;
import com.company.ddd.domain.model.user.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * =================================
 * <p>
 * Created by cjj on 18-11-24.
 * <p>
 * 描述: 控制器
 */

@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private IUserService userService;

    @GetMapping
    public ResponseEntity get() {
        User admin = userService.test("admin");
        return new ResponseEntity(admin, HttpStatus.MULTI_STATUS);
    }

}
